<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:include href="core\form.xsl"/>
	<xsl:include href="core\level0.xsl"/>
	<xsl:include href="core\pager.xsl"/>
	
<xsl:template match="page">
	<xsl:call-template name="page_content"/>
</xsl:template>

<xsl:template name="page_content">
	<!--  -->
	<xsl:choose>
	<xsl:when test="rowset[@id='insurance_companies_search']">
	<table cellspacing="0" cellpadding="4" width="100%">
	<tr><td align="center">
<a href="premium_insurance_companies.asp" class="linkbold" title="Premium Insurance Companies List"><font color="{$color_main_first1}">Premium Insurance Companies List</font></a> &#160;|&#160; <font color="#666666"><b>All Insurance Companies</b></font> &#160;|&#160; <a href="insurance_companies_search.asp" class="linkbold" title="Insurance Company Search"><font color="{$color_main_first1}">Insurance Company Search</font></a>
	</td></tr>
</table>
	<xsl:call-template name="title_page">
		<xsl:with-param name="titleText">
			All Insurance Companies List
		</xsl:with-param>
	</xsl:call-template>
		<xsl:apply-templates select="rowset[@id='insurance_companies_search']"/>
	</xsl:when>
	<xsl:otherwise>
<table cellspacing="0" cellpadding="4" width="100%">
	<tr><td align="center">
<a href="premium_insurance_companies.asp" class="linkbold" title="Premium Insurance Companies List"><font color="{$color_main_first1}">Premium Insurance Companies List</font></a> &#160;|&#160; <a href="main.asp?-insurance_companies_search.asp-=&amp;insurance_companies_list_frm_auto=1&amp;company_name=&amp;states_id=61&amp;countries_id=&amp;submit.x=80&amp;submit.y=7" class="linkbold" title="All Insurance Companies"><font color="{$color_main_first1}">All Insurance Companies</font></a> &#160;|&#160; <font color="#666666"><b>Insurance Company Search</b></font>
	</td></tr>
</table>
	<xsl:call-template name="title_page">
		<xsl:with-param name="titleText">
			Insurance Company Search
		</xsl:with-param>
	</xsl:call-template>
		<xsl:apply-templates select="form[@name='insurance_companies_list']"/>
	</xsl:otherwise>
	</xsl:choose>
</xsl:template>

<xsl:template match="form[@name='insurance_companies_list']">
	<table cellpadding="4" cellspacing="5" align="center" width="100%">
	<form action="main.asp">
	<input type="Hidden" name="-insurance_companies_search.asp-"/>
	<xsl:copy-of select="@*"/>
	<xsl:apply-templates select="control/input[@type='hidden']"/>
	<tr><td><xsl:value-of select="../status"/></td></tr>
	<tr>
		<td align="center">
			
			<table cellpadding="2" cellspacing="2" align="center">
				<tr>
					<td background="{$img_path_templates}/hr_vert_grey.gif" width="1" rowspan="1">
						<img src="{$img_path_templates}/spacer.gif" alt="" width="2" height="20" border="0"/>
					</td>
					<td class="titleblack" align="center" valign="top">
						<table cellpadding="4" cellspacing="5" align="center">
			<tr><td colspan="2"  class="titleblack" align="left" valign="top">Company Name &#160;&#160;&#160;<xsl:apply-templates select="control[@name='company_name']/input"/></td></tr>
			<tr>
				<td class="titleblack" align="left" valign="top"><xsl:apply-templates select="control[@name='states_id']"/></td>
				<td class="titleblack" align="left" valign="top"><xsl:apply-templates select="control[@name='countries_id']"/></td>
			</tr>
			
			</table>
					</td>
					<td background="{$img_path_templates}/hr_vert_grey.gif" width="1" rowspan="1">
						<img src="{$img_path_templates}/spacer.gif" alt="" width="2" height="20" border="0"/>
					</td>
				</tr>
				<tr><td align="center" colspan="3"><input type="image" border="0" vspace="15" name ="submit" src="{$img_path_templates}/{$header_bg_color}/buttons/btn_submit.gif"/></td></tr>
			</table>			
		</td>
	</tr>
	</form>
	</table>
</xsl:template>

<xsl:template match="rowset[@id='insurance_companies_search']">
	<!-- <table cellpadding="0" cellspacing="0" border="0" width="100%">
	<tr>
    	<td align="right" width="100%" background="images/red_line.gif"><img src="images/sphere.gif" alt="" width="38" height="23" border="0"/></td><td align="right"><h1 class="titlepageall"><nobr>All Insurance 1 Companies List</nobr></h1></td>
	</tr>
    </table> -->
			<table width="100%" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td>
						<xsl:apply-templates select="../Pager/form"/>
						<xsl:apply-templates select="../Pager"/>
					</td>
				</tr>
			</table>

<br/>
	<xsl:call-template name="tab_title"><xsl:with-param name="title_text"></xsl:with-param></xsl:call-template>
	<table cellspacing="2" cellpadding="0" align="center">
	<tr bgcolor="{$header_bg_color}">
 		<td  class="listtitle">&#160;Company Name <img src="{$img_path_templates}/spacer.gif" alt="" align="absmiddle" width="2" height="30" border="0"/></td>
		<td  class="listtitle">&#160;Address</td>
		<td  class="listtitle">&#160;Contact Information</td>
	</tr>
	<xsl:for-each select="data/row">
	<xsl:variable name="url"><xsl:value-of select="col[@name='url']"/></xsl:variable>
	<xsl:variable name="email"><xsl:value-of select="col[@name='email']"/></xsl:variable>
	<xsl:variable name="ic_id"><xsl:value-of select="col[@name='insurance_companies_id']"/></xsl:variable>
 	<xsl:variable name="src">
		<xsl:value-of select="$media_path"/>
		<xsl:value-of select="concat('/',col[@name='logo'])"/>
<!-- 		<xsl:value-of select="concat('/images/logos/other_companies/insurance/',$ic_id,'/',$ic_id,'_m_',col[@name='logo'])"/> -->
	</xsl:variable>
 	<tr>
 		<!--  <xsl:choose>
			<xsl:when test="position() mod 2 != 0">
				<xsl:attribute name="bgcolor">#E6E6E6</xsl:attribute>
			</xsl:when>
			<xsl:otherwise>
				<xsl:attribute name="bgcolor">#EFEFEF</xsl:attribute>
			</xsl:otherwise>
		</xsl:choose> -->
		
		<xsl:choose>
			<xsl:when test="string-length(col[@name='logo'])>4">
				<td valign="top" align="center">
				<img src="{$img_path_templates}/spacer.gif" alt="" width="150" height="6" border="0"/>
				
				<div align="left" style="padding-left : 15px;"><b><xsl:value-of select="col[@name='name']" disable-output-escaping="yes"/>&#160;&#160;&#160;&#160;</b></div><img border="0" vspace="2" hspace="4" align="middle">
				<xsl:attribute name="src">
					<xsl:value-of select="$src" disable-output-escaping="yes"/>
				</xsl:attribute>
				<xsl:attribute name="alt">
					<xsl:value-of select="col[@name='name']" disable-output-escaping="yes"/>
				</xsl:attribute>
				</img>
				</td> <!-- style="padding-left : 6px;" -->
			</xsl:when>
			<xsl:otherwise>
				<td valign="top"><img src="{$img_path_templates}/spacer.gif" alt="" width="150" height="6" border="0"/>
				<div align="left" style="padding-left : 15px;"><b><xsl:value-of select="col[@name='name']" disable-output-escaping="yes"/>&#160;&#160;&#160;&#160;</b></div>
				<img src="{$img_path_templates}/spacer.gif" alt="" width="150" height="4" border="0"/>
				</td>
			</xsl:otherwise>
		</xsl:choose>
		<td bgcolor="{$color_right_info}">
			<div align="left" style="padding-left : 10px;"><xsl:if test="string-length(col[@name='address_1'])>0"><xsl:value-of select="col[@name='address_1']"/>&#160;&#160;&#160;&#160;<br/></xsl:if>
			<xsl:if test="string-length(col[@name='address_2'])>0"><xsl:value-of select="col[@name='address_2']"/><br/></xsl:if>
			<xsl:if test="string-length(col[@name='address_3'])>0"><xsl:value-of select="col[@name='address_3']"/><br/></xsl:if>
			<xsl:if test="string-length(col[@name='city'])>0"><xsl:value-of select="col[@name='city']"/>, </xsl:if> 
			<xsl:if test="string-length(col[@name='state'])>0 and not(col[@name='state']='--Not specified--')"><xsl:value-of select="col[@name='state']"/></xsl:if>
			<xsl:if test="string-length(col[@name='zipcode'])>0">, <xsl:value-of select="col[@name='zipcode']"/></xsl:if><br/>
			<xsl:value-of select="col[@name='country']"/></div>
		</td>
		<td valign="top">
			<table cellspacing="0" cellpadding="0">
			
			<xsl:if test="string-length(col[@name='phone'])>0">
			<tr>
				<td>&#160;&#160;</td>
				<td><img src="{$img_path_templates}/{$header_bg_color}/buttons/phone.gif" border="0" hspace="2" vspace="2"/></td>
				<td>&#160; 
				Phone:&#160;&#160;
				<xsl:value-of select="col[@name='phone']"/></td>
			</tr>
			</xsl:if>
			
			<xsl:if test="string-length(col[@name='fax'])>0">
			<tr>
				<td>&#160;&#160;</td>
				<td></td>
				<td>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Fax:&#160;&#160;
				<xsl:value-of select="col[@name='fax']"/>		</td>
			</tr>
			</xsl:if>
			<xsl:if test="string-length(col[@name='email'])>0">
			<tr>
				<td>&#160;&#160;</td>
				<td><a href="main.asp?-insurance_companies_email.asp-&amp;icompany_id={col[@name='insurance_companies_id']}&amp;ic_email={col[@name='email']}"><img src="{$img_path_templates}/{$header_bg_color}/buttons/contact_to_broker.gif" border="0" hspace="2" vspace="2" valign="bottom"/></a></td>
				
				<td>&#160;<a href="main.asp?-insurance_companies_email.asp-&amp;icompany_id={col[@name='insurance_companies_id']}&amp;ic_email={col[@name='email']}"><font color="{$color_main_first1}"><xsl:value-of select="col[@name='email']"/></font></a></td>
			</tr>
			</xsl:if>
			<xsl:if test="string-length($url)>0">
			<tr>
				<td>&#160;&#160;</td>
				<td><a href="http://www.yachtcouncil.com/link_redir.asp?cid={col[@name='insurance_companies_id']}&amp;furl={col[@name='url']}" target="_blank"><img src="{$img_path_templates}/{$header_bg_color}/buttons/site.gif" border="0" vspace="2" hspace="2" valign="bottom"/></a>
				</td>
				<td>&#160;<a href="http://www.yachtcouncil.com/link_redir.asp?cid={col[@name='insurance_companies_id']}&amp;furl={col[@name='url']}" target="_blank"><font color="{$color_main_first1}"><xsl:value-of select="col[@name='url']" disable-output-escaping="yes"/></font></a>
				</td>
			</tr>
			</xsl:if>
			
			<xsl:if test="col[@name='NumberOfContacts']>0">
			<tr>
				<td>&#160;&#160;</td>
				<td><a href="#" title="Contacts View"><xsl:attribute name="onClick">
								window.open('contacts_view.asp?companies_id=<xsl:value-of select="$ic_id"/>&amp;company=ins',null,'height=250,width=400,left=100,top=100,resizable=yes,scrollbars=yes')
							</xsl:attribute><img src="{$img_path_templates}/{$header_bg_color}/buttons/info.gif" border="0" vspace="2" hspace="2" valign="bottom"/></a></td>
				<td>&#160;<a href="#" title="Contacts View"><xsl:attribute name="onClick">
								window.open('contacts_view.asp?companies_id=<xsl:value-of select="$ic_id"/>&amp;company=ins',null,'height=250,width=400,left=100,top=100,resizable=yes,scrollbars=yes')
							</xsl:attribute><font color="{$color_main_first1}">View Company Contacts</font>
			</a></td>
			</tr>
			</xsl:if> 
			<xsl:if test="col[@name='descr_len']>0">	
			<tr>
				<td>&#160;&#160;</td>
				<td><a href="insurance_company_details.asp?companies_id={$ic_id}" title="Company Details"><img src="{$img_path_templates}/{$header_bg_color}/buttons/btn_det.gif" border="0" vspace="2" hspace="2" valign="bottom"/></a></td>
				<td>&#160;<a href="insurance_company_details.asp?companies_id={$ic_id}" title="Company Details">	<font color="{$color_main_first1}">View Company Details</font>
			</a></td>
			</tr>
			</xsl:if> 
			</table>
			<!-- <xsl:if test="col[@name='descr_len']>0"><br/><br/>
			<a href="insurance_company_info.asp?iCompany={$ic_id}&amp;mode=popup" onClick="return windowOpen( 'insurance_company_info.asp?iCompany={$ic_id}&amp;mode=popup', 'ICID', 550, 350, 3)">
				View Company Info
			</a>
			</xsl:if> -->
			
		</td>
	</tr>
	<tr><td colspan="3" bgcolor="#e0e0e0"><img src="{$img_path_templates}/spacer.gif" alt="" width="150" height="1" border="0"/></td></tr>
	</xsl:for-each>
	</table>
			<table width="100%" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td>
						<xsl:apply-templates select="../Pager/form"/>
						<xsl:apply-templates select="../Pager"/>
					</td>
				</tr>
			</table>
</xsl:template>

</xsl:stylesheet>
